package com.thf.controller;

import com.thf.model.TopFootModels;
import com.thf.service.impl.NavServiceImpl;

import javax.servlet.http.HttpServletRequest;

public class TopFootUtil {
    static void setNavTitleHref(HttpServletRequest req){

        NavServiceImpl ns = new NavServiceImpl();
        String[] titleData = ns.getNavData("D:/test/navTitleData.txt", "D:\\huarui03\\web\\WEB-INF\\note", "navTitleData.txt");
        String[] hrefData = ns.getNavData("D:/test/navHrefData.txt", "D:\\huarui03\\web\\WEB-INF\\note", "navHrefData.txt");
        TopFootModels[] topFootModels = new TopFootModels[titleData.length];
        for (int i = 0; i <titleData.length; i++) {
            TopFootModels tf =new TopFootModels();
            tf.setTitle(titleData[i]);
            tf.setHref(hrefData[i]);
            topFootModels[i] = tf ;
        }
        req.setAttribute("topFootModels",topFootModels);
    }
}
